package com.blockmeta.bbs.immodule.broadcast;

import android.content.Intent;
import com.blankj.utilcode.util.LogUtils;

import com.blockmeta.bbs.immodule.Constants;
import com.blockmeta.bbs.immodule.bean.Params;
import com.blockmeta.bbs.immodule.corebean.Impl.IMApplicationContext;
import com.blockmeta.bbs.immodule.corebean.IMMetaBase;
import com.blockmeta.bbs.immodule.corebean.MsgWorker;
import com.blockmeta.bbs.immodule.dao.ChatMessage;
import com.blockmeta.bbs.immodule.dao.Todo;

public class IMMsgDispatcher {

    private static IMMsgDispatcher mInstance;
    public static IMMsgDispatcher getInstance(){
        if(mInstance == null){
            synchronized (IMMsgDispatcher.class){
                if(mInstance == null){
                    return new IMMsgDispatcher();
                }
            }
        }
        return mInstance;

    }


    public void dispatch(String key, Intent intent) {

        MsgWorker worker = IMApplicationContext.getIMMetaService().getWorker();
        if(worker == null)return;

        worker.dispatch(key, intent.getExtras());

    }
}
